package com.ccrfid.rmc6.service.toolcase;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.toolcase.ToolCaseEntity;
import com.ccrfid.rmc6.entity.toolcase.ToolEntity;
import com.ccrfid.rmc6.entity.toolcase.ToolTakeRecordEntity;
import com.ccrfid.rmc6.entity.toolcase.ToolTakeRecordView;
import com.ccrfid.rmc6.pojo.dto.LocatorAssetCount;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface ToolCaseService {
    //分页查询工具箱列表
    Page<ToolCaseEntity> getToolCasePage(SearchCriteria criteria, Pageable pageable);

    //获取某个工具箱
    ToolCaseEntity getToolCaseById(Long toolCaseId) throws AppException;

    ToolCaseEntity getToolCaseByCardNumber(Long cardNumber) throws AppException;

    //新增工具箱
    ToolCaseEntity createToolCase(ToolCaseEntity entity) throws AppException;

    //更新工具箱信息
    ToolCaseEntity updateToolCase(Long toolCaseId, ToolCaseEntity entity) throws AppException;

    //删除某个工具箱
    Boolean deleteToolCase(Long toolCaseId) throws AppException;

    //获取某个工具箱内的全部工具
    List<ToolEntity> getToolsInToolCase(Long toolCaseId) throws AppException;

    //为某个工具箱添加工具
    ToolEntity createTool(Long toolCaseId, ToolEntity toolEntity) throws AppException;

    //修改某个工具信息
    ToolEntity updateTool(Long toolCaseId, Long toolId, ToolEntity toolEntity) throws AppException;

    //删除某个工具信息
    Boolean deleteTool(Long toolCaseId, Long toolId) throws AppException;

    //工具箱借出
    Boolean toolCaseTakeOut(Long toolCaseId, ToolTakeRecordEntity entity) throws AppException;

    //工具箱归还
    Boolean toolCaseTakeBack(Long toolCaseId) throws AppException;

    //工具箱借出记录分页查询
    Page<ToolTakeRecordView> getToolCaseTakeRecords(SearchCriteria criteria, Pageable pageable);

    //查看工具箱分布
    List<LocatorAssetCount> getToolCaseDistribution(Integer floorNumber);

    //查询某个定位器下的工具箱信息
    List<ToolCaseEntity> getToolCaseUnderLocator(Integer locatorNumber);

    //查询某个位置下的工具箱信息
    List<ToolCaseEntity> getToolCaseUnderPos(double x, double y);
}
